clc;
clear;
bone_file = 'xuhu_01Char00.calc';
[LarmBone,RarmBone,CenterBone, LlegBone, RlegBone] = getAllData (bone_file);
frame = size(LarmBone(1).num);


cnt = 1;
while cnt <= frame(1,1)
    [Larm,Rarm,Cent,Lleg,Rleg] = Recombine(LarmBone,RarmBone,CenterBone, LlegBone, RlegBone,cnt);
    
    subplot(2,2,1);
    view_x = -59;
    view_y = 7;
    GifPlot3(Larm,view_x,view_y);
    GifPlot3(Rarm,view_x,view_y);
    GifPlot3(Cent,view_x,view_y);
    GifPlot3(Lleg,view_x,view_y);
    GifPlot3(Rleg,view_x,view_y);
    subplot(2,2,2);
    view_x = 0;
    view_y = 90;
    GifPlot3(Larm,view_x,view_y);
    GifPlot3(Rarm,view_x,view_y);
    GifPlot3(Cent,view_x,view_y);
    GifPlot3(Lleg,view_x,view_y);
    GifPlot3(Rleg,view_x,view_y);
    subplot(2,2,3);
    view_x = 0;
    view_y = 0;
    GifPlot3(Larm,view_x,view_y);
    GifPlot3(Rarm,view_x,view_y);
    GifPlot3(Cent,view_x,view_y);
    GifPlot3(Lleg,view_x,view_y);
    GifPlot3(Rleg,view_x,view_y);
    subplot(2,2,4);
    view_x = 90;
    view_y = 0;
    GifPlot3(Larm,view_x,view_y);
    GifPlot3(Rarm,view_x,view_y);
    GifPlot3(Cent,view_x,view_y);
    GifPlot3(Lleg,view_x,view_y);
    GifPlot3(Rleg,view_x,view_y);
    
    
    
    m2(cnt)=getframe(gcf);
    hold off;
    cnt=cnt+5;
end
fclose all;